import { getList as bannerList } from '@/api/banner'

export default {
  data() {
    return {
      isDev: process.env.APP_ENV === 'local',
      leftAdv: ''
    }
  },
  created() {
    bannerList({
      limit: 1,
      type: 13,
      state: 0,
      sort: '+sort'
    }).then(response => {
      this.leftAdv = response.data[0]
      if (this.leftAdv) {
        this.leftAdv.url = this.leftAdv.url ? this.leftAdv.url.replace('?id=', '/') : ''
      }
    })
  },
  methods: {
    close() {
      this.leftAdv = ''
    }
  }
}
